package com.unicomcz.xh;

import java.sql.ResultSet;
import java.util.List;

import com.unicomcz.DetailPageAction;

public class MobXhAction extends DetailPageAction
{
        private String hm;
        private int minFee=0;
        private int maxFee=9999;
        public MobXhAction() {
            setRowPerpage(80);
        }
        /**
         * @return the hm
         */
        public String getHm()
        {
            return hm;
        }
        /**
         * @param hm the hm to set
         */
        public void setHm(String hm)
        {
            this.hm = hm;
        }
        /**
         * @return the minFee
         */
        public int getMinFee()
        {
            return minFee;
        }
        /**
         * @param minFee the minFee to set
         */
        public void setMinFee(int minFee)
        {
            this.minFee = minFee;
        }
        /**
         * @return the maxFee
         */
        public int getMaxFee()
        {
            return maxFee;
        }
        /**
         * @param maxFee the maxFee to set
         */
        public void setMaxFee(int maxFee)
        {
            this.maxFee = maxFee;
        }
        public String getSqlStr() {
            String sqlStr="SELECT serial_number,depart_id,price FROM dls_mob_xh_number WHERE depart_id IN ('" +userInfo.getUserId()+"','"+userInfo.getQx()+"','531')"+ 
                    " and price between "+Integer.toString(minFee)+" and "+Integer.toString(maxFee);
            if ((hm!=null)&&(hm.trim().compareTo("")!=0)) {
                sqlStr += " and serial_number like '%"+hm+"%' ";
            }
            sqlStr +=" order by 3,1";
            return sqlStr;
        }
        public Object[] getParams() {
            return new Object[]{};
        }
        protected void regQueryParam() throws Exception{
        }
        
        protected void rs2List(ResultSet rs,List out) throws Exception{
             HmBean a = new HmBean();
             a.setSerialNumber(rs.getString(1));
             a.setPrice(Integer.toString(rs.getInt(3)));
             out.add(a);
        }
}
